<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>个人中心</title>
  <style>
    ul {
      list-style: none;
    }
  </style>
</head>

<body>
  <ul id="info">

  </ul>
  <script>
    let raw = location.search.substr(1).split('=')[1]
    console.log('raw: ', raw);

    var userinfo = JSON.parse(decodeURIComponent(raw))
    console.log('userinfo: ', userinfo);

    if (userinfo) {
      document.getElementById('info').innerHTML = `
            <li>
              头像: <span><img width="60px" src="${userinfo.headimgurl}"/></span>
            </li>
            <li>
              昵称: <span>${userinfo.niackname}</span>
            </li>
            <li>
              性别: <span>${userinfo.sex === 1 ? '男' : '女'}</span>
            </li>
            <li>
              国家: <span>${userinfo.country}</span>
            </li>
            <li>
              省份: <span>${userinfo.province}</span>
            </li>
            <li>
              城市: <span>${userinfo.city}</span>
            </li>
      `;
    }
  </script>
</body>

</html>